package llmserviceopenai.routes

import io.ktor.server.application.call
import io.ktor.server.request.receive
import io.ktor.server.response.respond
import io.ktor.server.routing.*

import llmserviceopenai.service.RerankService
import llmserviceopenai.model.RerankRequest


fun Route.rerankerRoutes(rerankerService: RerankService){

    post("/reranker") {

        // 拿请求
        val request = call.receive<RerankRequest>()

        // 调用
        val responsed = rerankerService.rerankHandler(request)

        // 返回
        call.respond(responsed)
    }
}